package com.lingjtx.common.core.constant;

// 短信模板
public enum SmsTemplate {
    DEFAULT(0, "SMS_463211300", "正能"), // 默认一个验证码模板
    VERIFICATION_CODE(1, "SMS_463211300", "正能"), // 验证码
    NOTICE(2, "SMS_270895154", "正能"), // 发送告警信息
    POPULARIZE(3, "", "正能"); // 推广


    private String signName;
    private int code;
    private String templateCode;

    SmsTemplate(int code, String templateCode, String signName) {
        this.code = code;
        this.templateCode = templateCode;
        this.signName = signName;
    }

    public int getCode() {
        return code;
    }

    public String getTemplateCode() {
        return templateCode;
    }

    public String getSignName() {
        return signName;
    }

    public static SmsTemplate codeOf(int code) {
        for (SmsTemplate value : SmsTemplate.values()) {
            if (code == value.getCode()) {
                return value;
            }
        }
        return DEFAULT;
    }

    @Override
    public String toString() {
        return this.getTemplateCode();
    }
}
